package com.zee.activity.ui

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.ImageView
import com.zee.activity.R
import com.zee.adapter.SimpleZxBannerAdapter
import com.zee.log.ZLog
import com.zee.toast.ToastUtils

import kotlinx.android.synthetic.main.activity_banner.*

/**
 * @author Administrator
 */
class BannerViewActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
//        ZEventBusUtils.register(this);
        setContentView(R.layout.activity_banner)
        var array = intArrayOf(R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher)

        id_banner_view.setBannerAdapter(object : SimpleZxBannerAdapter<Int>(array.toList()) {
            override fun initViews(imageView: ImageView, position: Int) {
                imageView.setImageResource(array[position])
            }
        })
//        id_banner_view.setBannerAdapter()

//        id_click_toast_banner.setOnClickListener {
//            ToastUtils.showCustomView("测试显示出来了吗？", R.layout.toast_custom_view)
//
//        }
    }

//    @SubscribeMainThread(tag = "1")
//    public fun initTitle(value:Int){
//
//    }
//
//    @SubscribeMainThread(tag = "1")
//    public fun initTitle2(value:Int){
//
//    }

    override fun onDestroy() {
        super.onDestroy()
//        ZEventBusUtils.unregister(this)
    }
}
